package com.relax.mybatis.plugin.sensitive.strategy.impl;

import org.apache.commons.lang3.StringUtils;

import com.relax.mybatis.plugin.sensitive.strategy.SensitiveStrategy;

/**
 * @author relax
 * @date 2022/07/05
 * @desc 密码脱敏策略
 */
public class PasswordSensitiveStrategy implements SensitiveStrategy {

    /**
     * <p>
     * 密码脱敏：全部不显示
     * </p>
     *
     * <pre>
     * PasswordSensitiveStrategy.handle("123456") = "******"
     * </pre>
     *
     * @param data
     * @param symbol
     * @return
     */
    @Override
    public String handle(String data, String symbol) {
        return StringUtils.repeat(symbol, StringUtils.length(data));
    }

}
